home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Space & Astronomy
/
Space and Astronomy (October 1993).iso
/
mac
/
VIEWERS
/
MSDOS
/
GIFLIB12.ZIP
/
DOC
/
GIF2BGI.DOC
< prev
next >
Wrap
Text File
|
1991-05-13
|
3KB
|
88 lines
Gif2BGI
--------
Program to display images saved as GIF files on IBM PC display devices using
the BGI (Borland) driver interface.
The program has few stages as follows:
1. Reads GIF file header and determines size of it.
2. Dynamically allocate enough memory to hold all the image internally.
One byte per pixel is always allocated, so a little bit more than
width*height (of screen, not image) bytes are required.
3. Reads all the image in. Interlaced images are read correctly in, although
they are displayed sequentially.
4. Display first image using the defaults as set by the command line option.
5. Goes to interactive mode. For full description of the interactive mode
see below
Usage:
------
Gif2BGI [-q] [-d BGI Directory] [-u UserBGIDrv.Mode] [-z ZoomFactor] [-b]
[-h] GifFile
If no GifFile is given, Gif2BGI will try to read stdin for GIF file.
Memory required:
----------------
Screen.
Options:
--------
1. [-q] : quite mode. Default off on MSDOS, on on unix. Controls printout
of running scan lines. Use -q- to turn off.
2. [-d BGI Directory] : Where should we look for default drivers (as supplied
by Borland). For example '-d c:/tc/bgi'.
3. [-u UserBGIDrv.Mode] : Specifies user defined BGI driver. If for example
you have a BGI driver for your special vga called MYVGA.BGI and you want
to run it in mode 2 then type '-u c:/tc/bgi/myvga.2'. Note the absolute
path to the driver must be specified. Also note that we use '/' and not
'\' so they would not be treated as options.
4. [-z ZoomFactor] : Sets zoom factor of the image. Zoom factor should be
power of 2 up to 256. Default is 1 (no zoom).
5. [-h] : print one command line help, similar to Usage above.
Interactive mode:
-----------------
Once the image is displayed, the program goes into interactive mode
which recognizes the following commands:
1. C - get Color and Position.
In this sub menu, a cursor appears, and the Color of the pixel the cursor
is on, with its position in GIF file screen are printed. The 4 arrows may
be used (shifted for faster movement) to move the cursor. Any other key will
abort this sub mode.
2. D - Zoom Down by factor of 2 unless current zoom factor is 1.
3. R - Redraw the image.
4. S - print Status of image and program.
5. U - Zoom Up by factor of 2 unless current zoom factor is 256.
6. 4 arrow keys can be used to pan to the desire direction, if the image
overflow to that direction. If, on the other hand, the image fit into the
Hercules device, arrow keys are ignored. The panning steps are 1/2 screen if
not on image end.
7. ' ' - Space bar may be used to abort current image drawing.
8. ESC - Escape key may be used to abort the program.
Notes:
------
As no color quantization is used in this program if a GIF image has more
colors than the BGI driver support, this program will abort.
This driver is optimized for drivers with one byte per pixel (256 colors)
and will run MUCH faster in these cases.
Bugs:
-----
For some reason I could not figure out on my ATI wonder card, int 10h call
10h (AH = AL = 10h) to set the color registers sometimes result with wrong
colors. Direct access of the card registers gives correct results. I dont do
that to make this program portable but if your driver gives wrong colors it
is probably because it is using this bios call. Any one has anything to add?